{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-1"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import cv2\n",
    "\n",
    "im = cv2.imread('Lena.jpg')\n",
    "gray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY)\n",
    "cv2.imshow('Color',im)\n",
    "cv2.imshow('Gray',gray)\n",
    "HSV = cv2.cvtColor(im,cv2.COLOR_BGR2HSV)\n",
    "cv2.imshow('HSV',HSV)\n",
    "H = cv2.split(HSV)[0]  # H通道  \n",
    "S = cv2.split(HSV)[1]  # S通道  \n",
    "V = cv2.split(HSV)[2]  # V通道\n",
    "cv2.imshow('H',H)      # H中显示的是Hue色度，人物肤色，帽子颜色，墙面颜色差不多，所以在色度里应该是差不多的；\n",
    "cv2.imshow('S',S)      # S中显示的是Saturation饱和度，从图中看到，高光面颜色基本都是白色，饱和度比较高，在饱和度图中相对较深；\n",
    "cv2.imshow('V',V)      # V中显示的是Value亮度，亮度图应该和以前的黑白电视效果差不多。\n",
    "cv2.waitKey(0)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
